package com.xh.bussiness.tiku.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xh.bussiness.tiku.dao.ChapterKnowledgeMapper;
import com.xh.bussiness.tiku.model.ChapterKnowledge;
import com.xh.bussiness.tiku.model.Knowledge;
import com.xh.bussiness.tiku.service.IChapterKnowledgeService;
import com.xh.core.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 试题知识点表 服务实现类
 * </p>
 *
 * @author daiwei
 * @since 2019-01-14
 */
@Service
public class ChapterKnowledgeServiceImpl extends BaseServiceImpl<ChapterKnowledgeMapper, ChapterKnowledge> implements IChapterKnowledgeService {

    @Override
    public void batchDelete(String chapterId, List<String> knowledgeIds) {
        this.dao.batchDelete(chapterId, knowledgeIds);
    }

    @Override
    public List<ChapterKnowledge> queryByKnowledgeIds(List<String> knowledgeIds) {
        QueryWrapper<ChapterKnowledge> qw = new QueryWrapper<>();
        qw.in("knowledge_id", knowledgeIds);
        return this.dao.selectList(qw);
    }
}
